add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
+ gtk_container_class_handle_border_width (container_class);
+
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_NOTEBOOK_ACCESSIBLE);
gtk_widget_class_set_css_name (widget_class, "notebook");
}
GtkNotebookPrivate *priv = notebook->priv;
GtkAllocation allocation, action_allocation;
GtkWidget *widget = GTK_WIDGET (notebook);
- guint border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
GtkNotebookPage *visible_page = NULL;
GList *tmp_list;
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
gtk_widget_get_allocation (widget, &allocation);
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
- rectangle->x = allocation.x + border_width;
- rectangle->y = allocation.y + border_width;
+ rectangle->x = allocation.x;
+ rectangle->y = allocation.y;
switch (tab_pos)
{
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
- rectangle->width = allocation.width - 2 * border_width;
+ rectangle->width = allocation.width;
rectangle->height = visible_page->requisition.height;
if (tab_pos == GTK_POS_BOTTOM)
- rectangle->y += allocation.height - 2 * border_width - rectangle->height;
+ rectangle->y += allocation.height - rectangle->height;
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
rectangle->width = visible_page->requisition.width;
- rectangle->height = allocation.height - 2 * border_width;
+ rectangle->height = allocation.height;
if (tab_pos == GTK_POS_RIGHT)
- rectangle->x += allocation.width - 2 * border_width - rectangle->width;
+ rectangle->x += allocation.width - rectangle->width;
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkNotebookPrivate *priv = notebook->priv;
- guint border_width;
gint stack_min, stack_nat, header_min, header_nat;
if (!priv->show_tabs)
*minimum = MAX (header_min, stack_min);
*natural = MAX (header_nat, stack_nat);
}
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
- *minimum += border_width * 2;
- *natural += border_width * 2;
}
static void
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkNotebookPrivate *priv = notebook->priv;
GtkAllocation stack_allocation, header_allocation;
- gint border_width;
if (gtk_widget_get_realized (widget))
{
gdk_window_hide (priv->event_window);
}
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- stack_allocation.x = allocation->x + border_width;
- stack_allocation.y = allocation->y + border_width;
- stack_allocation.width = allocation->width - 2 * border_width;
- stack_allocation.height = allocation->height - 2 * border_width;
+ stack_allocation = *allocation;
if (!priv->show_tabs)
{
GtkWidget *widget;
GtkNotebookPage *page;
GdkRectangle redraw_rect;
- gint border;
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
widget = GTK_WIDGET (notebook);
- border = gtk_container_get_border_width (GTK_CONTAINER (notebook));
if (!gtk_widget_get_mapped (widget) || !priv->cur_page)
return;
page = priv->cur_page;
- redraw_rect.x = border;
- redraw_rect.y = border;
+ redraw_rect.x = 0;
+ redraw_rect.y = 0;
gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
if (allocation.width <= 1)
switch (tab_pos)
{
case GTK_POS_BOTTOM:
- redraw_rect.y = allocation.height - border -
- page->allocation.height;
+ redraw_rect.y = allocation.height - page->allocation.height;
/* fall through */
case GTK_POS_TOP:
- redraw_rect.width = MAX (1, allocation.width - 2 * border);
+ redraw_rect.width = allocation.width;
redraw_rect.height = page->allocation.height;
break;
case GTK_POS_RIGHT:
- redraw_rect.x = allocation.width - border -
- page->allocation.width;
+ redraw_rect.x = allocation.width - page->allocation.width;
/* fall through */
case GTK_POS_LEFT:
redraw_rect.width = page->allocation.width;
- redraw_rect.height = MAX (1, allocation.height - 2 * border);
+ redraw_rect.height = allocation.height;
break;
}
GtkWidget *widget;
GtkNotebookPage *page;
GdkRectangle redraw_rect;
- gint border;
GtkPositionType tab_pos = get_effective_tab_pos (notebook);
widget = GTK_WIDGET (notebook);
- border = gtk_container_get_border_width (GTK_CONTAINER (notebook));
if (!gtk_widget_get_mapped (widget) || !priv->cur_page)
return;
page = priv->cur_page;
- redraw_rect.x = border;
- redraw_rect.y = border;
+ redraw_rect.x = 0;
+ redraw_rect.y = 0;
gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
{
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
- redraw_rect.width = allocation.width - 2 * border;
+ redraw_rect.width = allocation.width;
if (tab_pos == GTK_POS_TOP)
{
- redraw_rect.y = border + page->allocation.y +
- page->allocation.height;
+ redraw_rect.y = page->allocation.y + page->allocation.height;
redraw_rect.height = 0;
}
else
{
- redraw_rect.y = allocation.height - border -
- page->allocation.height;
+ redraw_rect.y = allocation.height - page->allocation.height;
redraw_rect.height = 0;
}
break;
case GTK_POS_LEFT:
case GTK_POS_RIGHT:
- redraw_rect.height = allocation.height - 2 * border;
+ redraw_rect.height = allocation.height;
if (tab_pos == GTK_POS_LEFT)
{
- redraw_rect.x = border + page->allocation.x + page->allocation.width;
+ redraw_rect.x = page->allocation.x + page->allocation.width;
redraw_rect.width = 0;
}
else
{
- redraw_rect.x = allocation.width - border -
- page->allocation.width;
+ redraw_rect.x = allocation.width - page->allocation.width;
redraw_rect.width = 0;
}
break;
GtkNotebookPrivate *priv = notebook->priv;
GtkAllocation allocation;
GtkWidget *widget;
- GtkContainer *container;
GtkNotebookPage *page;
GtkStyleContext *context;
gboolean allocate_at_bottom;
gint tab_extra_space;
GtkPositionType tab_pos;
gint left_x, right_x, top_y, bottom_y, anchor;
- guint border_width;
gboolean gap_left, packing_changed;
GtkAllocation child_allocation = { 0, };
GtkOrientation tab_expand_orientation;
g_assert (priv->cur_page != NULL);
widget = GTK_WIDGET (notebook);
- container = GTK_CONTAINER (notebook);
tab_pos = get_effective_tab_pos (notebook);
allocate_at_bottom = get_allocate_at_bottom (widget, direction);
anchor = 0;
gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
- border_width = gtk_container_get_border_width (container);
- child_allocation.x = allocation.x + border_width;
- child_allocation.y = allocation.y + border_width;
+ child_allocation.x = allocation.x;
+ child_allocation.y = allocation.y;
context = gtk_widget_get_style_context (widget);
{
case GTK_POS_BOTTOM:
child_allocation.y = allocation.y + allocation.height -
- priv->cur_page->requisition.height - border_width;
+ priv->cur_page->requisition.height;
/* fall through */
case GTK_POS_TOP:
child_allocation.x = (allocate_at_bottom) ? max : min;
case GTK_POS_RIGHT:
child_allocation.x = allocation.x + allocation.width -
- priv->cur_page->requisition.width - border_width;
+ priv->cur_page->requisition.width;
/* fall through */
case GTK_POS_LEFT:
child_allocation.y = (allocate_at_bottom) ? max : min;